<template>
  <div id="all">
      <div class="title">
          <div style="float: left"><a href="">/&nbsp;所有</a></div>
          <div style="float: right;" class="replay"><a href="">最新回复</a></div>
      </div>
      <div class="news">
        <div class="lunbo">
          <div class="swiper-box">
              <rd-swipe :swipe="swipe">
                <div class="rd-swipe-item" :style="{ 'background-image': `url(${img})` }" v-for="(img, index) in imgs">
                </div>
              </rd-swipe>
            </div>
        </div>
        <div class="post" v-for="(item,index) in news" >
            <h3 :style="item.post.style">{{ item.post.title}}</h3>
            <div class="main">
                <ul>
                    <li v-for="(lis,flag) in item.post.context"><a :href="lis.url">{{ lis.text }}</a></li>
                </ul>
            </div>
        </div>
      </div>
      <div style="width: 100%;clear: left;height: 10px;"></div>
      <div class="area">

          <div class="kf" v-for="(item,index) in service">
              <div class="bt">
                <div class="text">{{ item.title }}<span style="display: none;">{{ test[0] }}</span></div>
                <a href="javascript:;" @click="listdown(index)"><div class="icon" ><i :class="kficon[index]" style="font-size: 30px;line-height: 40px" ></i>&nbsp;&nbsp;</div></a>
              </div>
              <transition name="fade" mode="out-in">
              <div class="nr" v-if="nrshow[index]">
                  <div class="block" v-for="(lis,flag) in item.context">
                      <div class="icon"><a :href="lis.url"><i :class="lis.icon"></i></a></div>
                      <div class="text">
                          <p class="p1"><a href="lis.url">{{ lis.bt }}</a></p>
                          <p class="p2">{{ lis.question }}</p>
                          <p class="p3">主题: {{ lis.zt }}, 帖数: {{ lis.num }}</p>
                      </div>
                  </div>
                  <div style="clear:left;width: 100%;"></div>
              </div>
              </transition>
          </div>

      </div>
        </div>
</template>

<script>
import rdSwipe from '../Public/slide.vue'
export default {
  data () {
    return {
      nrshow:[true,true,true,true,true,true],
      kficon:['fa fa-angle-down','fa fa-angle-down','fa fa-angle-down','fa fa-angle-down','fa fa-angle-down'],
      test:[],
      service:[
        {
          title:'客服咨询',
          context:[
            {
              icon:'fa fa-university',
              bt:'日常使用问题',
              question:'为您解决微商城/零售/餐饮/美业/收银等产品使用问题',
              zt:'20万',
              num:'77万',
              url:'./service/1.html'
            },
            {
              icon:'fa fa-university',
              bt:'分销业务使用问题',
              question:'为您解决分销市场/分销商/供货商/全员开店的使用问题',
              zt:'2万',
              num:'8万',
              url:'./service/2.html'
            },
            {
              icon:'fa fa-university',
              bt:'商家提现',
              question:'私密版块',
              zt:'1万',
              num:'6万',
              url:'./service/3.html'
            },
            {
              icon:'fa fa-university',
              bt:'交易纠纷',
              question:'私密版块',
              zt:'3万',
              num:'1万',
              url:'./service/4.html'
            },
            {
              icon:'fa fa-university',
              bt:'店铺认证',
              question:'为您解决店铺认证、店铺资料修改、管理员更替等使用问题',
              zt:'8750',
              num:'3万',
              url:'./service/5.html'
            }
          ]
        },
        {
          title:'商户交流',
          context:[
            {
              icon:'fa fa-university',
              bt:'运营杂谈',
              question:'我们期待，不同的观点在此碰撞',
              zt:'3696',
              num:'13万',
              url:'./service/6.html'
            },
            {
              icon:'fa fa-university',
              bt:'资源下载',
              question:'提供运营方案、行业报告等网络资源下载',
              zt:'19',
              num:'1850',
              url:'./service/7.html'
            },
            {
              icon:'fa fa-university',
              bt:'开发者交流',
              question:'私密版块',
              zt:'1万',
              num:'6万',
              url:'./service/8.html'
            },
            {
              icon:'fa fa-university',
              bt:'有赞商盟',
              question:'私密版块',
              zt:'3万',
              num:'1万',
              url:'./service/9.html'
            },
            {
              icon:'fa fa-university',
              bt:'聊天专版 ',
              question:'为您解决店铺认证、店铺资料修改、管理员更替等使用问题',
              zt:'8750',
              num:'3万',
              url:'./service/10.html'
            }
            ,
            {
              icon:'fa fa-university',
              bt:'货号你就来 ',
              question:'为您解决店铺认证、店铺资料修改、管理员更替等使用问题',
              zt:'8750',
              num:'3万',
              url:'./service/11.html'
            }
          ]
        },
        {
          title:'官方专区',
          context:[
            {
              icon:'fa fa-university',
              bt:'新手教程',
              question:'我们期待，不同的观点在此碰撞',
              zt:'3696',
              num:'13万',
              url:'./service/12.html'
            },
            {
              icon:'fa fa-university',
              bt:'产品动态',
              question:'提供运营方案、行业报告等网络资源下载',
              zt:'19',
              num:'1850',
              url:'./service/13.html'
            },
            {
              icon:'fa fa-university',
              bt:'常见问题',
              question:'私密版块',
              zt:'1万',
              num:'6万',
              url:'./service/14.html'
            },
            {
              icon:'fa fa-university',
              bt:'有赞公告',
              question:'私密版块',
              zt:'3万',
              num:'1万',
              url:'./service/15.html'
            },
            {
              icon:'fa fa-university',
              bt:'有赞规则 ',
              question:'为您解决店铺认证、店铺资料修改、管理员更替等使用问题',
              zt:'8750',
              num:'3万',
              url:'./service/16.html'
            }
          ]
        }
      ],
      news:[{
        post:{
          title:'最新帖子',
          style:'color:#333',
          context:[
            {
              text:'有赞小程序讨论版｜晒晒你的小程序',
              url:'./post/1.html'
            },
            {
              text:'【美业新功能】oh营销工具：体验价来',
              url:'./post/2.html'
            },
            {
              text:'【产品预告】一起来探讨会议类活动的需求',
              url:'./post/3.html'
            },
            {
              text:'云南商盟线下沙龙：寻找下一个十万单爆品',
              url:'./post/4.html'
            },
            {
              text:'【有赞DSP广告投放教程】定向能力概述',
              url:'./post/5.html'
            },
            {
              text:'【新手必看】开网店做生意，赚钱速度翻倍',
              url:'./post/6.html'
            },
            {
              text:'线下展会吸粉最接地气的实操，精准粉丝',
              url:'./post/7.html'
            }
          ]
        }},
        {post:{
          title:'本周热帖',
          style:'color:#FF5050',
          context:[
            {
              text:'有赞分销平台业务升级：品质分销',
              url:'./hot/1.html'
            },
            {
              text:'晒一晒这些年遇见的牛逼玩法6.27更',
              url:'./hot/2.html'
            },
            {
              text:'有赞商家线下门店案例集合2017.06',
              url:'./hot/3.html'
            },
            {
              text:'【产品发布】小程序支持一键授权',
              url:'./hot/4.html'
            },
            {
              text:'有赞学堂讲师团正在招募中',
              url:'./hot/5.html'
            },
            {
              text:'有赞的101种小玩法动图合集（11',
              url:'./hot/6.html'
            },
            {
              text:'我对微信小程序的日常运营和前景展望',
              url:'./hot/7.html'
            }
          ]
        }
      }],
      swipe: {
        activeIndex: 0
      },
      contacts: [{
        text: 'Page 1'
      }, {
        text: 'Page 2'
      }, {
        text: 'Page 3'
      }, {
        text: 'Page 4'
      }],
      imgs: [
        'http://covteam.u.qiniudn.com/test18.jpg',
        'http://covteam.u.qiniudn.com/test19.jpg',
        'http://covteam.u.qiniudn.com/test20.jpg',
        'http://covteam.u.qiniudn.com/test21.jpg'
      ]
    }
  },
  components: {
    rdSwipe
  },
  methods: {
    turnTo (index) {
      this.$children.map(swipe => {
          if (swipe.turnTo) {
              swipe.turnTo(index)
          }
      })
    },
    listdown(index){
       if(this.nrshow[index]  == true){
          this.kficon[index] = 'fa fa-angle-up';
          this.nrshow[index] =false;
          this.test='';
       }else{
          this.kficon[index] = 'fa fa-angle-down';
          this.nrshow[index] = true;
          this.test='11';
       }
    }
  }
}
</script>

<style scoped>
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.5s;
}

.fade-enter, .fade-leave-active {
    opacity: 0;
}
#all{
  width:1000px;
  margin:0 auto;
}
.title{
  width: 980px;
  margin:0 auto;
  height: 30px;
  padding-left: 10px;
  padding-right: 10px;
}
.title a{
  font:13px/30px '微软雅黑';
  color:#666;
}

.title .replay a{
  color:orange;
}
.area{
  width: 100%;
}
.area .kf{
  width: 100%;
  margin-bottom: 20px;
}
.area .kf .bt{
  height: 40px;
  background-color:#fff;
  color:#000;
  padding:0 20px;
  border-bottom: 1px solid #eee;
}
.area .kf .bt .text{
  color:#000;
  font:bold 15px/40px '微软雅黑';
  float: left;
}
.area .kf .bt .icon{
  float: right;
}
.area .kf .nr{
  padding:20px 3%;
  width: 94%;
  background-color:#fff;
}
.area .kf .nr .block{
  width: 50%;
  height: 100px;
  float: left;
}
.area .kf .nr .block .icon{
  height:100%;
  width: 17%;
  text-align: center;
  float: left;
}
.area .kf .nr .block .text{
  width:83%;
  height: 100%;
  float: right;
}
.area .kf .nr .block .text .p1 a{
  font:20px/35px '微软雅黑';
  color:#FE5050;
}
.area .kf .nr .block .text .p2 {
  font:12px/20px '微软雅黑';
  color:#666;
}
.area .kf .nr .block .text .p3{
  font:12px/20px '微软雅黑';
  color:#999;
}
.area .kf .nr .block .icon i{
  color:#FE5050;
  line-height: 90px;
  font-size: 40px;
}
.news{
  width: 100%;
}
.news .post{
  margin-left: 10px;
  float: left;
  height: 255px;
  width: 26.5%;
  background-color:#fff;
}
.news .post h3 {
    height: 45px;
    padding: 0 10px;
    line-height: 42px;
    font-size: 16px;
    font-weight: 400;
    border-bottom: 1px solid #eee;
}
.news .post .main{
  height: 210px;
  width: 100%;
  margin-top:5px;
}
.news .post .main ul li{
  height: 28px;
  padding:0 10px;
  line-height:28px;
  
}
.news .post .main ul li a{
  font:12px/29px '微软雅黑';
  color:#666; 
}
.news .post .main ul li a:hover{
  color:#FF5050;
}
.news .lunbo{
  width: 45%;
  height: 255px;
  float: left;
}
.contacts {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #fff;
  margin-bottom: 1rem;
}
.contact {
  color: #fff;
  font-size: 14px;
  width: 100%;
  line-height: 3rem;
  text-align: center;
  border-bottom: 2px solid rgba(0,0,0,0);
  cursor: pointer;
}
.contact.active {
  border-bottom: 2px solid #fff;
}

.swiper-box {
  height: 260px;
  width: 100%;
  margin: auto;
}
.swiper-box  .rd-swipe {
  height: 255px;
  width: 100%;
}

</style>
